
package com.ltg.topactivity;

import com.ltg.widget.TestView;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class TestActivity extends Activity {
    TestView view;

    public TestActivity() {
        try {
            Class cls = Class.forName("android.app.ActivityManagerNative");
            Method me = cls.getMethod("getDefault");
            Class<? extends Object> nativeProxy = me.invoke(cls).getClass();
            Field remote = nativeProxy.getDeclaredField("mRemote");
            remote.setAccessible(true);
            String name = remote.get(me.invoke(cls)).getClass().getName();
            Log.d("manager", name);
        } catch (Exception e) {
            Log.e("manager", "", e);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(com.ltg.topactivity.R.layout.activity_main);
        setTitle("logo");
        Log.e("ac", "onCreate", new RuntimeException());
        onTestClicked(null);
        finish();

    }

    public void onTestClicked(View v) {
        // Intent intent = new Intent(Intent.ACTION_MAIN);
        Intent intent = new Intent();
        // intent.addCategory(Intent.CATEGORY_LAUNCHER);
        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//        intent.setClassName("com.lenovo.gameworld", "com.lenovo.gamecenter.pad.home.ui.LogoActivity");
         intent.setClass(this, TestActivity.class);
        startActivity(intent);
        
    }

    @Override
    protected void onNewIntent(Intent intent) {
        super.onNewIntent(intent);
        Log.e("ac", "onNewIntent", new RuntimeException());
    }

}
